import System from "~/utils/System";

export default class ApiTree {

  /**
    * 获取列表

    */
  static getList(){
      let param = {
      }
      
      return System.$httpData.get({
        url: "tree/getList",
        method: "post",
      },param)
  }

  /**
    @todo 添加
    @param name string - 名称
    */
  static add(name:string){
      let param = {
        name,
      }
      return System.$httpData.get({
        url: "tree/add",
        method: "post",
      },param)
  }

  /**
    @todo 编辑
    @param id integer - 主键
    @param name string - 名称
    */
  static edit(id:number,name:string){
      let param = {
        id,
        name,
      }
      return System.$httpData.get({
        url: "tree/edit",
        method: "post",
      },param)
  }

  /**
    * 删除
    @param value integer - id
    */
  static delete(value:number){
      let param = {
        value
      }
      return System.$httpData.get({
        url: "tree/delete",
        method: "post",
      },param)
  }

  /**
    * 详情
    @param id integer - id
    */
  static details(id:number){
      let param = {
        id
      }
      return System.$httpData.get({
        url: "tree/details",
        method: "post",
      },param)
  }


  /**
    @todo 编辑父节点
    @param id integer - 主键
    @param pid string - 父节点
    */
  static editPid(id:number,pid:string){
      let param = {
        id,
        pid,
      }
      return System.$httpData.get({
        url: "tree/editPid",
        method: "post",
      },param)
  }

}